<template>
    <m-page-wrapper>
        <m-crud ref="crudRef" :option="option">
        </m-crud>
    </m-page-wrapper>
</template>
<script setup lang="ts">
import { h, onMounted, ref,provide} from 'vue'
import { CrudType } from '/@/components/Crud/types';
import { Button, message } from 'ant-design-vue';
import { useRoute, useRouter } from "vue-router";
const route = useRoute();
const crudRef = ref()

provide('oilPipeName', route.query.name)
onMounted(() => {
    console.log('route.params++++++', route.query.name);
    // option = route.query.name
})
const option = ref<CrudType>({
    formProps: {
        labelWidth: '100px',
        // labelCol: { flex: '100px' },
    },
    // 标题
    title: '注油点列表',
    // 列表接口
    api: 'EdgeGateways/GetEdgeDeviceList',
    columns: [
        {
            title: '序号',
            dataIndex: 'injectorId',
            key: 'injectorId',
            list: true,
            view: false,
            add: false,
            edit: false,
            component: 'Input',
            componentProps: {
                type: "text",
                maxlength: 20,
            },
            rules: [{ required: false, message: '请输入边缘设备ID', trigger: 'blur' }]
        },
        {
            title: '注油点名称',
            dataIndex: 'name',
            key: 'name',
            search: true,
            searchType: "EQ",
            list: true,
            view: true,
            add: true,
            edit: true,
            component: 'Input',
            componentProps: {
            },
            rules: [{ required: false, message: '请输入设备名称', trigger: 'blur' }]
        },
        {
            title: '别名',
            dataIndex: 'description',
            key: 'description',
            list: true,
            view: true,
            add: true,
            edit: true,
            component: 'Input',
            componentProps: {
                type: "text",
                maxlength: 20,
            },
            rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
        },
        {
            title: '间隔时长（秒）',
            dataIndex: 'interval',
            key: 'interval',
            list: true,
            view: true,
            add: true,
            edit: true,
            component: 'Input',
            componentProps: {
                type: "text",
                maxlength: 20,
            },
            rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
        },
        {
            title: '编号',
            dataIndex: 'number',
            key: 'number',
            list: true,
            view: true,
            add: true,
            edit: true,
            component: 'Input',
            componentProps: {
                type: "text",
                maxlength: 20,
            },
            rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
        },
        {
            title: '管理ID',
            dataIndex: 'pipeID',
            key: 'pipeID',
            list: true,
            view: false,
            add: false,
            edit: false,
            component: 'Input',
            componentProps: {
                type: "text",
                maxlength: 20,
            },
            rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
        },
        {
            title: '节点ID',
            dataIndex: 'nodeID',
            key: 'nodeID',
            list: true,
            view: false,
            add: false,
            edit: false,
            component: 'Input',
            componentProps: {
                type: "text",
                maxlength: 20,
            },
            rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
        },
        {
            title: '次数',
            dataIndex: 'volume',
            key: 'volume',
            list: true,
            view: true,
            add: false,
            edit: false,
            component: 'Input',
            componentProps: {
            },
            rules: [{ required: false, message: '请输入应用编码', trigger: 'blur' }]
        },

        {
            title: '日志',
            dataIndex: 'stateLog',
            key: 'stateLog',
            list: true,
            view: true,
            add: true,
            edit: true,
            component: 'Input',
            componentProps: {
            },
            rules: [{ required: false, message: '请输入备注', trigger: 'blur' }]
        },
        {
            title: '创建时间',
            dataIndex: 'registerTime',
            key: 'registerTime',
            list: false,
            view: false,
            add: false,
            edit: false,
            component: 'DatePicker',
            componentProps: {
                valueFormat: "YYYY-MM-DD",
                mode: "date",
                format: "YYYY-MM-DD",
            },
            rules: [{ required: false, message: '请输入创建时间', trigger: 'blur' }]
        },
        {
            title: '创建用户',
            dataIndex: 'createUser',
            key: 'createUser',
            list: false,
            view: false,
            add: false,
            edit: false,
            component: 'Input',
            componentProps: {
                type: "text",
            },
            rules: [{ required: false, message: '请输入创建用户', trigger: 'blur' }]
        },
        {
            title: '更新时间',
            dataIndex: 'updateTime',
            key: 'updateTime',
            list: false,
            view: false,
            add: false,
            edit: false,
            component: 'DatePicker',
            componentProps: {
                valueFormat: "YYYY-MM-DD",
                mode: "date",
                format: "YYYY-MM-DD",
            },
            rules: [{ required: false, message: '请输入更新时间', trigger: 'blur' }]
        },
        {
            title: '更新用户',
            dataIndex: 'updateUser',
            key: 'updateUser',
            list: false,
            view: false,
            add: false,
            edit: false,
            component: 'Input',
            componentProps: {
                type: "text",
            },
            rules: [{ required: false, message: '请输入更新用户', trigger: 'blur' }]
        },
        {
            title: '是否删除',
            dataIndex: 'isDeleted',
            key: 'isDeleted',
            list: false,
            view: false,
            add: false,
            edit: false,
            component: 'Input',
            componentProps: {
                type: "text",
            },
            rules: [{ required: false, message: '请输入是否删除', trigger: 'blur' }]
        },]


})

</script>
<style lang="less" scoped></style>